﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="../../js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=VD7f9qqVQlU2bPZLhycKXeb8"></script>
    <script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script>
    <script src="../../js/config.js"></script>
    <style>
        html, body {
            padding: 0px;
            margin: 0px;
        }
    </style>
</head>
<body>
    <div id="map" style="width:100vw;height:100vh;"></div>
    <script type="text/javascript">
        $(document).ready(function (e)
        {
            var map = new BMap.Map('map');
            var poi = new BMap.Point(Resquest.lng, Resquest.lat);
            map.enableScrollWheelZoom(true); 
         //   map.centerAndZoom(poi, 18);
            map.addControl(new BMap.NavigationControl());
            var marker = new BMap.Marker(poi);   

          //  map.addOverlay(marker);


            //坐标转换完之后的回调函数
            translateCallback = function (point) {
                var marker = new BMap.Marker(point);
                map.addOverlay(marker);
                var label = new BMap.Label("" + Resquest.name, { offset: new BMap.Size(20, -10) });
                marker.setLabel(label); //添加百度label
               // map.setCenter(point);
                map.centerAndZoom(point, 18);
                console.log(point.lng + "," + point.lat);
            }

            setTimeout(function () {
                BMap.Convertor.translate(poi, 0, translateCallback);     //真实经纬度转成百度坐标
            }, 50);

        })
    </script>
</body>
</html>